package kr.co.shoppingmall.board;

import java.util.HashMap;
import java.util.List;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

public class BoardDAOImpl extends SqlMapClientDaoSupport implements BoardDAO {

	@Override
	public void insertBoard(BoardDTO dto) {
		getSqlMapClientTemplate().insert("insertBoard", dto);
	}

	@Override
	public List getBoardList(HashMap map) {
		return getSqlMapClientTemplate().queryForList("getBoardList", map);
	}

	@Override
	public int getCount() {
		return (int) getSqlMapClientTemplate().queryForObject("getCount");
	}

	@Override
	public BoardDTO getBoard(int board_num) {
		return (BoardDTO) 
			getSqlMapClientTemplate().queryForObject("getBoard", board_num);
	}

	@Override
	public void updateHit(int board_num) {
		getSqlMapClientTemplate().update("updateHit", board_num);
	}

	@Override
	public void updateBoard(BoardDTO dto) {
		getSqlMapClientTemplate().update("updateBoard", dto);
	}

	@Override
	public void deleteBoard(BoardDTO dto) {
		getSqlMapClientTemplate().delete("deleteBoard", dto);
	}

	@Override
	public void updateReply(BoardDTO dto) {
		getSqlMapClientTemplate().update("updateReply", dto);
	}

	@Override
	public void insertReply(BoardDTO dto) {
		getSqlMapClientTemplate().insert("insertReply", dto);
	}

}//end